package com.dmap.analysispoint.controller.rpc;

import com.dmap.analysispoint.constants.BurialPointConstant;
import com.dmap.analysispoint.service.BurialPointInfoAnalysisByDateService;
import com.dmap.base.constants.Constant;
import com.dmap.base.send.email.MailService;
import com.dmap.base.vo.BaseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.mail.MessagingException;

/**
 * \* @author:zhouhao
 * \* Date:10/05/2018
 * \* Description:
 * \*
 */

@Api(value = "埋点信息分析处理", description = "background/埋点信息分析处理")
@Controller
@RequestMapping(value = "/background/dmap-analysis-point-server/v2/burialPointInfoAnalysisByDate/")

public class BurialPointInfoAnalysisByDateController {

    @Value("${spring.profiles.active}")
    private String environment;

    @Resource
    private BurialPointInfoAnalysisByDateService burialPointInfoAnalysisByDateService;

    private static Logger logger = LoggerFactory.getLogger(BurialPointInfoAnalysisByDateController.class);

    @ResponseBody
    @ApiOperation(value = "埋点信息转移到BurialPointAll表",
            notes = "1.传入所要查询的参数，参数为前一天零点的时间戳、前一天23点59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointAll", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointAll(@RequestParam(value = "startTime") Long startTime,
                                             @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointAll(startTime, endTime);
            if (success > 0) {
                success = burialPointInfoAnalysisByDateService.deleteInfoFromBurialPointByDate(startTime, endTime);
                if (success == 0) {
                    baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                    baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
                }
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按天对埋点信息定时自动分析处理(将所有数据迁移到insertInfoToBurialPointAll表)成功");
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(将所有数据迁移到insertInfoToBurialPointAll表)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按天对埋点信息定时自动分析处理(将所有数据迁移到insertInfoToBurialPointAll表) error: " + e);
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(将所有数据迁移到insertInfoToBurialPointAll表)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "新增帐号信息转移到BurialPointAddUser表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointAddUser", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointAddUser(@RequestParam(value = "startTime") Long startTime,
                                                 @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointAddUser(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增用户)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按按小时对埋点信息定时自动分析处理(新增用户)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增用户)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(新增用户)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "新增设备信息转移到BurialPointAddEquipment表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointAddEquipment", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointAddEquipment(@RequestParam(value = "startTime") Long startTime,
                                                      @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointAddEquipment(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增设备)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(新增设备)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增设备)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(新增设备)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "新增手机信息转移到BurialPointAddPhone表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointAddPhone", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointAddPhone(@RequestParam(value = "startTime") Long startTime,
                                                  @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointAddPhone(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增手机)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(新增手机)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增手机)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(新增手机)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "新增APP版本信息转移到BurialPointAppVersion表",
            notes = "1.传入所要查询的参数，参数为前一天零点的时间戳、前一天23点59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointAppVersion", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointAppVersion(@RequestParam(value = "startTime") Long startTime,
                                                    @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointAppVersion(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增App版本信息)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(新增App版本信息)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(新增App版本信息)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(新增App版本信息)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "按天分析帐号信息转移到BurialPointDayUser表",
            notes = "1.传入所要查询的参数，参数为前一天零点的时间戳、前一天23点59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointDayUser", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointDayUser(@RequestParam(value = "startTime") Long startTime,
                                                 @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointDayUser(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按用户去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按用户去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按用户去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按用户去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "按天分析手机信息转移到BurialPointDayPhone表",
            notes = "1.传入所要查询的参数，参数为前一天零点的时间戳、前一天23点59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointDayPhone", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointDayPhone(@RequestParam(value = "startTime") Long startTime,
                                                  @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointDayPhone(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "按天分析设备信息转移到BurialPointDayEquipment表",
            notes = "1.传入所要查询的参数，参数为前一天零点的时间戳、前一天23点59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointDayEquipment", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointDayEquipment(@RequestParam(value = "startTime") Long startTime,
                                                      @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointDayEquipment(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按设备sn去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按天对埋点信息定时自动分析处理(按设备sn去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "按小时分析帐号信息转移到BurialPointHourUser表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointHourUser", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointHourUser(@RequestParam(value = "startTime") Long startTime,
                                                  @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointHourUser(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按用户去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按用户去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按用户去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按用户去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }


    @ResponseBody
    @ApiOperation(value = "按小时分析手机信息转移到BurialPointHourPhone表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointHourPhone", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointHourPhone(@RequestParam(value = "startTime") Long startTime,
                                                   @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointHourPhone(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按手机唯一标识imei去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

    @ResponseBody
    @ApiOperation(value = "按小时分析设备信息转移到BurialPointHourEquipment表",
            notes = "1.传入所要查询的参数，参数为小时开始0分0秒的时间戳、小时结束59分59秒的时间戳\n" +
                    "2.返回处理数据的条数")
    @RequestMapping(value = "insertInfoToBurialPointHourEquipment", method = RequestMethod.GET)
    public BaseVo insertInfoToBurialPointHourEquipment(@RequestParam(value = "startTime") Long startTime,
                                                       @RequestParam(value = "endTime") Long endTime) {
        BaseVo baseVo = new BaseVo();
        int success = 0;
        try {
            if (startTime == null || endTime == null || endTime == 0) {
                baseVo.setCode(Constant.RESPONSE_PARAM_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_PARAM_ERROR_MSG);
            }
            success = burialPointInfoAnalysisByDateService.insertInfoToBurialPointHourEquipment(startTime, endTime);
            if (success == 0) {
                baseVo.setCode(Constant.RESPONSE_INSERT_ERROR_CODE);
                baseVo.setMsg(Constant.RESPONSE_INSERT_ERROR_MSG);
            }
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务成功");
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务 MailService.sendMail error:  {}", me);
            }
        } catch (Exception e) {
            try {
                MailService.sendMail(BurialPointConstant.EMAIL_ADDRESS, BurialPointConstant.EMAIL_SUBJECT + " — " + "环境:" + environment, "按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务 error: " + e);
            } catch (MessagingException me) {
                logger.error("按小时对埋点信息定时自动分析处理(按设备sn去重)定时任务 MailService.sendMail error:  {}", me);
            }
        }
        baseVo.setData(success);
        return baseVo;
    }

}
